/*
 * SplashFrame.java
 * --------------------
 * A Dialog box that shows our splash image and goes away when you click it.
 */
package othello.gui;

import java.awt.BorderLayout;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JLabel;

public class SplashFrame extends JDialog implements MouseListener {
    
    public SplashFrame() {
        JLabel image = new JLabel(new ImageIcon(getClass().getClassLoader().getResource("img/starter.jpg")));
        getContentPane().add(image, BorderLayout.CENTER);
        pack();
        addListener();
        setModal(true);
        setLocationRelativeTo(null);
        setVisible(true);
    }
    
    
    private void addListener() {
        addMouseListener(this);
    }
    
    public void mouseClicked(MouseEvent e) {
        setVisible(false);
        dispose();
    }

    public void mousePressed(MouseEvent e) {
    }

    public void mouseReleased(MouseEvent e) {
    }

    public void mouseEntered(MouseEvent e) {
    }

    public void mouseExited(MouseEvent e) {
    }
}